package com.fishery.order.service.client;

import com.fishery.entity.Result;
import com.fishery.order.entity.client.MaterialInventory;
import com.fishery.order.handler.FactoryClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author run
 * @since 2021/2/5 17:52
 */
@FeignClient(value = "fishery-processing-service", fallback = FactoryClientFallback.class)
public interface FactoryClient {

	@PutMapping("/processing/batch/{id}/{count}")
	public Result setProductCount(@PathVariable(value = "id") String batchId
			, @PathVariable(value = "count") Double weight);

	@PostMapping("/processing/material/")
	public Result createMaterial(@RequestBody MaterialInventory material);

	@GetMapping("/processing/batch/before/{id}")
	public Result getSourceMessage(@PathVariable(name = "id", required = true) String id);

	@GetMapping("/processing/batch/root/{id}")
	public Result getMessageOfBatch(@PathVariable(value = "id") String batchId);

}
